/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:张熳
 * Date:2025-08-29
 * Time:5:45
 */
//内部类
//实例内部类
public class OutClass2 {
    //成员变量
    public int date1 = 1;
    public int date2 = 2;
    //静态成员变量
    public static int date3 = 3;
    //成员方法
    public void testA() {
        System.out.println("testA()");
    }
    //静态成员方法
    public static void testB() {
        System.out.println("testB()");
    }

    //实例内部类
    class InnerClass2 {
        public int date4 = 4;
        private int date5 = 5;
        public static int date6 = 6;
        public int date1 = 1000;
        public void test() {
            OutClass2 outClass2 = new OutClass2();
            System.out.println(outClass2.date1);
            System.out.println(OutClass2.this.date1);
            System.out.println(this.date1);
            System.out.println(date1);
            System.out.println("实例内部类-test()");
            //直接访问外部类的非静态成员
            date1 = 10;
            date2 = 20;
            testA();
            //直接访问外部类的静态成员
            date3 = 30;
            testB();
        }
    }
}
